package com.ershui.blog.article.service.impl;

import com.ershui.blog.article.domain.LCategory;
import com.ershui.blog.article.mapper.LCategoryMapper;
import com.ershui.blog.article.service.LCategoryService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;
import java.util.Map;

/**
 * 博文分类service
 */
@Service
public class LCategoryServiceImpl implements LCategoryService {
    @Autowired
    private LCategoryMapper categoryMapper;

    @Override
    public int insert(LCategory record) {
        return categoryMapper.insert(record);
    }

    @Override
    public int insertSelective(LCategory record) {
        return categoryMapper.insertSelective(record);
    }

    @Override
    public void updateSelective(LCategory record) {
        categoryMapper.updateSelective(record);
    }

    @Override
    public void deleteCategoryById(Long id)
    {
        categoryMapper.deleteCategoryById(id);
    }

    @Override
    public List<LCategory> selectCategorys() {
        return categoryMapper.selectCategorys();
    }

    @Override
    public Long CountArticleByCategoryId(Long id) {
        return categoryMapper.CountArticleByCategoryId(id);
    }
}
